<template>
	<view>
		<view class="cu-timeline" v-for="(item,index) in list" :key="index">
			<view class="cu-time">{{item.created_at}}</view>
			<view class="cu-item text-blue">
				<view class="content bg-cyan ">
					<view class="flex align-center">
						<view class="flex-sub flex align-center">
							<image class="cu-avatar round sm" style="margin-left: 0;" :src="item.user.avatar"
								mode="aspectFill">
								<text class="margin-left-xs margin-right-sm">{{item.user.nickname}}</text>
								<text v-if="item.id == goods_id">创建了ID</text>
								<text v-else-if="item.created_at == item.updated_at || !item.updated_at">收藏了ID</text>
								<text v-else>收藏并修改了ID</text>
						</view>
						<navigator hover-class="none" :url="'/pages/goods/simple_details?id='+item.id">
							查看
						</navigator>
					</view>
				</view>
			</view>
		</view>

	</view>
</template>

<script>
	import GoodsApi from "@/api/goods";
	export default {
		name: "GoodsSource",
		props: ['goods_id'],
		data() {
			return {
				list: [],
			}
		},
		mounted() {
			this.loadData();
		},
		methods: {
			loadData() {
				GoodsApi.source(this.goods_id).then((res) => {
					this.list = res;
				})
			},
		}
	}
</script>

<style>

</style>
